package com.ywu.application.standard.verify.config;

import com.ywu.application.standard.verify.dto.TypeEnum;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.context.annotation.Configuration;

import java.util.ArrayList;
import java.util.List;

/**
 * @ClassName VerifyConfig
 * @Description 验证码服务配置类
 * @Author GroundDemo
 * @Date 2023/11/11 20:17
 * @Version 1.0
 **/
@Configuration
@ConfigurationProperties(prefix = "ywu.verify")
@Getter
@Setter
@ToString
@RefreshScope
public class VerifyConfig {

    private static List<TypeEnum> typeInit = new ArrayList<>();

    static {
        typeInit.add(TypeEnum.WORD);
        typeInit.add(TypeEnum.NUMBER);
    }

    List<TypeEnum> type = typeInit;

    Integer len = 6;

    String fontName = "微软雅黑";

    Integer width = 120;

    Integer height = 40;

    Integer fontSize = 20;

    Integer interfereSize = 0;

    String tempFilePath = "~/temp/file/";

    Boolean refresh = false;
}
